

file(GLOB SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.c")
list(REMOVE_ITEM SOURCES src/lua.c src/luac.c src/print.c)

set(HEADERS src/lua.h src/luaconf.h src/lualib.h src/lauxlib.h)

include_directories(src)

# lua51 dll library
add_library(lua51 SHARED ${HEADERS} ${SOURCES})
set_target_properties(lua51 PROPERTIES DEFINE_SYMBOL LUA_BUILD_AS_DLL)
set_target_properties(lua51 PROPERTIES FOLDER BaseLib)
install(TARGETS lua51 RUNTIME DESTINATION ${INSTALL_DIR})
install(TARGETS lua51 ARCHIVE DESTINATION ${LIBRARY_DIR})
#install(FILES ${HEADERS} DESTINATION ${INCLUDE_DIR} )

# lua executable
add_executable(lua src/lua.c)
target_link_libraries(lua lua51)
set_target_properties(lua PROPERTIES FOLDER BaseLib)
install (TARGETS lua RUNTIME DESTINATION ${INSTALL_DIR})

